<?php
/**
 * IG_Product_Notice
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: Notice.php 524 2011-05-24 01:44:20Z mmxie $
 */
class IG_Product_Notice
{
    /**
     *
     * @param array $config
     * @return IG_Product_Notice_Abstract
     */
    static public function factory($config)
    {
        if (!isset($config['adapter'])) {
            throw new IG_Product_Exception('Unknow adapter for notice');
        }
        $adapterClassName = 'IG_Product_Notice_Adapter_' . ucfirst(strtolower($config['adapter']));
        unset($config['adapter']);
        Zend_Loader::loadClass($adapterClassName);
        $adapter = new $adapterClassName($config);
        return $adapter;
    }
}